package com.heima.user.feign;

import com.heima.apis.user.IUserClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.user.service.ApUserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: UserClient
 * Description:
 * date: 2023/8/29 0029 20:59
 *
 * @author zHan
 */
@RestController
@RequestMapping("/api/v1/user")
@Api(tags = "app端用户相关接口")
public class UserClient implements IUserClient {

    @Autowired
    private ApUserService apUserService;

    /**
     * 获取用户信息
     *
     * @param id
     * @return
     */
    @Override
    @GetMapping("/{id}")
    public ResponseResult getUserInfo(@PathVariable Integer id) {
        return ResponseResult.okResult(apUserService.getById(id));
    }
}
